import request from '/@/utils/request';
import {versions} from '/@/api/versions'

export function getDeptList(query?: object) {
    return request({
        url: `${versions}/system/dept/list`,
        method: 'get',
        params: query
    })
}


export function addDept(data: object) {
    return request({
        url: `${versions}/system/dept/add`,
        method: 'post',
        data: data
    })
}


export function editDept(data: object) {
    return request({
        url: `${versions}/system/dept/edit`,
        method: 'put',
        data: data
    })
}


export function deleteDept(id: number) {
    return request({
        url: `${versions}/system/dept/delete`,
        method: 'delete',
        data: {id}
    })
}

export function getDeptTree() {
    return request({
        url: `${versions}/system/dept/treeSelect`,
        method: 'get'
    })
}
